#ifndef MPU_6050_H
#define MPU_6050_H

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>

int init_mpu6050(int fd);
int read_data_from_mpu6050(int fd, unsigned char reg_H, unsigned char reg_L, unsigned short * pdata);
int read_byte_from_mpu6050(int fd, unsigned char reg, unsigned char * pdata);
int write_byte_to_mpu6050(int fd, unsigned char reg, unsigned char data);

#define SMPLRT_DIV  0x19
#define CONFIG   0x1A
#define GYRO_CONFIG  0x1B
#define ACCEL_CONFIG 0x1C
#define ACCEL_XOUT_H 0x3B
#define ACCEL_XOUT_L 0x3C
#define ACCEL_YOUT_H 0x3D
#define ACCEL_YOUT_L 0x3E
#define ACCEL_ZOUT_H 0x3F
#define ACCEL_ZOUT_L 0x40
#define TEMP_OUT_H  0x41
#define TEMP_OUT_L  0x42
#define GYRO_XOUT_H  0x43
#define GYRO_XOUT_L  0x44
#define GYRO_YOUT_H  0x45
#define GYRO_YOUT_L  0x46
#define GYRO_ZOUT_H  0x47
#define GYRO_ZOUT_L  0x48
#define PWR_MGMT_1  0x6B

#define I2C_SLAVE 0x703
#define I2C_TENBIT 0x704


#endif
